<!DOCTYPE html><html lang="en" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>CodingDGSun's Blog</title><meta name="author" content="CodingDGSun"><meta name="copyright" content="CodingDGSun"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta property="og:type" content="website">
<meta property="og:title" content="CodingDGSun&#39;s Blog">
<meta property="og:url" content="https://sunjie23.gitee.io/codingdgsun/page/3/index.html">
<meta property="og:site_name" content="CodingDGSun&#39;s Blog">
<meta property="og:locale" content="en_US">
<meta property="og:image" content="https://cdn.jsdelivr.net/gh/CodingDGSun/images-db@master/Blog/头像.7horht40yvwg.jpg">
<meta property="article:author" content="CodingDGSun">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://cdn.jsdelivr.net/gh/CodingDGSun/images-db@master/Blog/头像.7horht40yvwg.jpg"><link rel="shortcut icon" href="/codingdgsun/img/favicon.png"><link rel="canonical" href="https://sunjie23.gitee.io/codingdgsun/page/3/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/codingdgsun/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = { 
  root: '/codingdgsun/',
  algolia: undefined,
  localSearch: undefined,
  translate: undefined,
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
  copy: {
    success: 'Copy successfully',
    error: 'Copy error',
    noSupport: 'The browser does not support'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '',
  date_suffix: {
    just: 'Just',
    min: 'minutes ago',
    hour: 'hours ago',
    day: 'days ago',
    month: 'months ago'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: undefined,
  source: {
    jQuery: 'https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js',
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/js/jquery.justifiedGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/css/justifiedGallery.min.css'
    },
    fancybox: {
      js: 'https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.js',
      css: 'https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.css'
    }
  },
  isPhotoFigcaption: false,
  islazyload: false,
  isanchor: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: 'CodingDGSun\'s Blog',
  isPost: false,
  isHome: true,
  isHighlightShrink: false,
  isToc: false,
  postUpdate: '2022-01-17 14:06:45'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          if (t === 'dark') activateDarkMode()
          else if (t === 'light') activateLightMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
    const detectApple = () => {
      if (GLOBAL_CONFIG_SITE.isHome && /iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
        document.documentElement.classList.add('apple')
      }
    }
    detectApple()
    })(window)</script><meta name="generator" content="Hexo 5.4.0"><link rel="alternate" href="/codingdgsun/atom.xml" title="CodingDGSun's Blog" type="application/atom+xml">
</head><body><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="https://cdn.jsdelivr.net/gh/CodingDGSun/images-db@master/Blog/头像.7horht40yvwg.jpg" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="site-data"><div class="data-item is-center"><div class="data-item-link"><a href="/codingdgsun/archives/"><div class="headline">Articles</div><div class="length-num">59</div></a></div></div></div><hr/></div></div><div class="page" id="body-wrap"><header class="full_page" id="page-header"><nav id="nav"><span id="blog_name"><a id="site-name" href="/codingdgsun/">CodingDGSun's Blog</a></span><div id="menus"><div id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="site-info"><h1 id="site-title">CodingDGSun's Blog</h1></div><div id="scroll-down"><i class="fas fa-angle-down scroll-down-effects"></i></div></header><main class="layout" id="content-inner"><div class="recent-posts" id="recent-posts"><div class="recent-post-item"><div class="post_cover left_radius"><a href="/codingdgsun/2021/12/21/Markdown%E8%AF%AD%E6%B3%95%E5%85%A5%E9%97%A8/" title="Markdown语法入门">     <img class="post_bg" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/img/default.jpg" onerror="this.onerror=null;this.src='/codingdgsun/img/404.jpg'" alt="Markdown语法入门"></a></div><div class="recent-post-info"><a class="article-title" href="/codingdgsun/2021/12/21/Markdown%E8%AF%AD%E6%B3%95%E5%85%A5%E9%97%A8/" title="Markdown语法入门">Markdown语法入门</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">Created</span><time datetime="2021-12-21T02:56:12.000Z" title="Created 2021-12-21 10:56:12">2021-12-21</time></span></div><div class="content">Markdown 是一种轻量级标记语言标题123456# 一级标题## 二级标题### 三级标题#### 四级标题##### 五级标题###### 六级标题
一级标题二级标题三级标题四级标题五级标题六级标题
字体1234**加粗***斜体****加粗且斜体***~~删除线~~~

加粗斜体加粗且斜体~~删除线~~~

分隔线12---***

图片1![图片名称](图片本地地址，或网络的地址都可以)


超链接1[超链接名称](超链接地址)
网站

列表12345671. a2. b3. c- A- B- C

a
b
c


A
B
C


表格12345678|序号|姓名|年龄||:--|:--:|:--||1|张三|14||2|李四|3|-:  右对齐:-  左对齐:-: 居中对齐



序号
姓名
年龄



1
张三阿
14


2
李四
3



代码块1用```来表示
1这是代码块
</div></div></div><div class="recent-post-item"><div class="post_cover right_radius"><a href="/codingdgsun/2021/12/17/Dockerfile%E5%88%9B%E5%BB%BAUbuntu%E9%95%9C%E5%83%8F%E5%AE%9E%E8%B7%B5/" title="Dockerfile创建Ubuntu镜像实践">     <img class="post_bg" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/img/default.jpg" onerror="this.onerror=null;this.src='/codingdgsun/img/404.jpg'" alt="Dockerfile创建Ubuntu镜像实践"></a></div><div class="recent-post-info"><a class="article-title" href="/codingdgsun/2021/12/17/Dockerfile%E5%88%9B%E5%BB%BAUbuntu%E9%95%9C%E5%83%8F%E5%AE%9E%E8%B7%B5/" title="Dockerfile创建Ubuntu镜像实践">Dockerfile创建Ubuntu镜像实践</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">Created</span><time datetime="2021-12-17T09:00:17.000Z" title="Created 2021-12-17 17:00:17">2021-12-17</time></span></div><div class="content">手动安装Linux命令
下载Ubuntu镜像

1docker pull ubuntu


启动一个ubuntu容器

1docker run -it --name myubuntu01 ba6acccedd29 /bin/bash


查看Ubuntu版本

12cat /etc/issue//Ubuntu 20.04.3 LTS \n \l


查看ubuntu中基本命令，都无法使用

123vim     //文本编辑ifconfig        //显示或配置网络设备ping        //因特网包探索器，用于测试网络连接量的程序


手动安装命令

1234apt-get update      //更新源列表apt-get install -y  vim     //安装文本编辑命令 apt-get install -y  net-tools       //安装显示或配置网络设备命令apt-get install -y  iputils-ping        //安装ping命令





命令安装成功，测试没问题


使用Dockerfile创建Ubuntu镜像 ...</div></div></div><div class="recent-post-item"><div class="post_cover left_radius"><a href="/codingdgsun/2021/12/17/Dockerfile%E5%88%9B%E5%BB%BACentOS%E9%95%9C%E5%83%8F%E5%AE%9E%E8%B7%B5/" title="Dockerfile创建CentOS镜像实践">     <img class="post_bg" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/img/default.jpg" onerror="this.onerror=null;this.src='/codingdgsun/img/404.jpg'" alt="Dockerfile创建CentOS镜像实践"></a></div><div class="recent-post-info"><a class="article-title" href="/codingdgsun/2021/12/17/Dockerfile%E5%88%9B%E5%BB%BACentOS%E9%95%9C%E5%83%8F%E5%AE%9E%E8%B7%B5/" title="Dockerfile创建CentOS镜像实践">Dockerfile创建CentOS镜像实践</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">Created</span><time datetime="2021-12-17T06:45:46.000Z" title="Created 2021-12-17 14:45:46">2021-12-17</time></span></div><div class="content">手动安装Linux命令
下载CentOS镜像

1docker pull centos


启动一个centos容器

1docker run -it --name mycentos01 5d0da3dc9764 /bin/bash


查看CentOS版本

12cat /etc/redhat-release//CentOS Linux release 8.4.2105


查看centos中基本命令，都无法使用

123clear       //清屏vim     //文本编辑ifconfig        //显示或配置网络设备


手动安装命令

123yum -y install vim      //安装文本编辑命令yum install -y  net-tools       //安装显示或配置网络设备命令yum install -y  ncurses     //安装清屏命令




命令安装成功，测试没问题


使用Dockerfile创建CentOS镜像
编写dockerfile

12345678910111213FROM centosMAINTAINER su ...</div></div></div><div class="recent-post-item"><div class="post_cover right_radius"><a href="/codingdgsun/2021/12/16/Dockerfile%E4%BD%BF%E7%94%A8%E5%85%A5%E9%97%A8/" title="Dockerfile使用入门">     <img class="post_bg" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/img/default.jpg" onerror="this.onerror=null;this.src='/codingdgsun/img/404.jpg'" alt="Dockerfile使用入门"></a></div><div class="recent-post-info"><a class="article-title" href="/codingdgsun/2021/12/16/Dockerfile%E4%BD%BF%E7%94%A8%E5%85%A5%E9%97%A8/" title="Dockerfile使用入门">Dockerfile使用入门</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">Created</span><time datetime="2021-12-16T02:57:57.000Z" title="Created 2021-12-16 10:57:57">2021-12-16</time></span></div><div class="content">使用Dockerfile生成镜像，并挂载数据卷
编写Dockerfile 注意：命令单词全部大写

1234FROM ubuntuVOLUME [&quot;volume1&quot;,&quot;volume2&quot;]CMD echo &quot;------Done------&quot;CMD /bin/bash



查看docker build帮助

123docker build --help     //查看docker build帮助        -f //dockerfile文件路径        -t //镜像别名:版本号


生成镜像并挂载数据卷

1docker build -f /Users/sunjie/Desktop/test-dockerfile/dockerfile01 -t my_ubuntu:1.0.0 .     //执行dockerfile生成镜像


启动一个容器

1docker run -it bbef8a39891f /bin/bash


在容器一个挂载卷中，新建文件



查看容器元数据，挂载卷的外面主机的目录

1dock ...</div></div></div><div class="recent-post-item"><div class="post_cover left_radius"><a href="/codingdgsun/2021/12/15/%E5%85%B3%E4%BA%8EMySQL%E7%9A%84%E5%AE%B9%E5%99%A8%E6%95%B0%E6%8D%AE%E5%8D%B7%E6%8C%82%E8%BD%BD%E5%AE%9E%E8%B7%B5/" title="关于MySQL的容器数据卷挂载实践">     <img class="post_bg" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/img/default.jpg" onerror="this.onerror=null;this.src='/codingdgsun/img/404.jpg'" alt="关于MySQL的容器数据卷挂载实践"></a></div><div class="recent-post-info"><a class="article-title" href="/codingdgsun/2021/12/15/%E5%85%B3%E4%BA%8EMySQL%E7%9A%84%E5%AE%B9%E5%99%A8%E6%95%B0%E6%8D%AE%E5%8D%B7%E6%8C%82%E8%BD%BD%E5%AE%9E%E8%B7%B5/" title="关于MySQL的容器数据卷挂载实践">关于MySQL的容器数据卷挂载实践</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">Created</span><time datetime="2021-12-15T14:48:33.000Z" title="Created 2021-12-15 22:48:33">2021-12-15</time></span></div><div class="content">关于MySQL的容器数据卷挂载实践
下载mysql 5.7 镜像

1docker pull mysql:5.7       //下载mysql 5.7 镜像


启动mysql容器，并挂载相应目录

12345docker run -d -p 3307:3306 -v /Users/sunjie/Desktop/conf:/etc/mysql/conf.d -v /Users/sunjie/Desktop/data:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=112233 --name=&quot;mysql01&quot; mysql:5.7        //后台方式运行mysql:5.7，数据库密码为：112233，容器别名：mysql01//外部主机端口3307映射到容器中的3306端口//将外部主机/Users/sunjie/Desktop/conf目录与容器中/etc/mysql/conf.d目录进行映射//将外部主机/Users/sunjie/Desktop/data目录与容器中/var/lib/mysql目录进行映射



使用MySQ ...</div></div></div><div class="recent-post-item"><div class="post_cover right_radius"><a href="/codingdgsun/2021/12/15/Docker%E5%AE%B9%E5%99%A8%E6%95%B0%E6%8D%AE%E5%8D%B7%E6%8C%82%E8%BD%BD%E4%BD%BF%E7%94%A8/" title="Docker容器数据卷挂载使用">     <img class="post_bg" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/img/default.jpg" onerror="this.onerror=null;this.src='/codingdgsun/img/404.jpg'" alt="Docker容器数据卷挂载使用"></a></div><div class="recent-post-info"><a class="article-title" href="/codingdgsun/2021/12/15/Docker%E5%AE%B9%E5%99%A8%E6%95%B0%E6%8D%AE%E5%8D%B7%E6%8C%82%E8%BD%BD%E4%BD%BF%E7%94%A8/" title="Docker容器数据卷挂载使用">Docker容器数据卷挂载使用</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">Created</span><time datetime="2021-12-15T05:48:05.000Z" title="Created 2021-12-15 13:48:05">2021-12-15</time></span></div><div class="content">Docker容器数据卷挂载使用1docker run --help       //查看运行容器帮助


1docker run -it -v /Users/sunjie/Desktop:/home tomcat        //以交互方式运行tomcat容器，并将外部主机的/Users/sunjie/Desktop与tomcat容器的/home目录进行映射

1docker exec -it 7ff84fa6ad4c /bin/bash      //进入容器查看目录内容

查看外部主机目录内容
1docker inspect 7ff84fa6ad4c     //查看容器元数据信息，确认数据卷挂载是否成功

在容器内目录创建文件，在外部主机目录可以查看到
在外部主机目录创建文件，在容器内目录可以查看到
注意删除容器后，外部主机挂载目录里面的文件还在，没有丢失
</div></div></div><div class="recent-post-item"><div class="post_cover left_radius"><a href="/codingdgsun/2021/12/15/%E6%8F%90%E4%BA%A4Docker%E9%95%9C%E5%83%8F/" title="提交Docker镜像">     <img class="post_bg" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/img/default.jpg" onerror="this.onerror=null;this.src='/codingdgsun/img/404.jpg'" alt="提交Docker镜像"></a></div><div class="recent-post-info"><a class="article-title" href="/codingdgsun/2021/12/15/%E6%8F%90%E4%BA%A4Docker%E9%95%9C%E5%83%8F/" title="提交Docker镜像">提交Docker镜像</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">Created</span><time datetime="2021-12-15T02:53:31.000Z" title="Created 2021-12-15 10:53:31">2021-12-15</time></span></div><div class="content">提交Docker镜像1docker pull tomcat      //下载tomcat镜像

1docker run -d --name=&quot;MyTomcat&quot; -p 8888:8080 tomcat     //后台方式，以外部主机端口8888映射容器端口8080，运行Tomcat，容器别名为MyTomcat

1curl localhost:8888     //测试访问显示404
此处要注意，【有坑】！


1docker exec -it 2dd5319e4047 /bin/bash      //进入容器

1cp -r webapps.dist/* webapps      //将webapps.dist目录下的所以文件，拷贝到webapps目录

1curl localhost:8888     //测试访问显示正常


123docker commit --help        //查看commit帮助        -a 作者        -m 提交的信息内容

1docker commit -a &quot;codingdgsun&quot ...</div></div></div><div class="recent-post-item"><div class="post_cover right_radius"><a href="/codingdgsun/2021/12/14/%E5%8F%AF%E8%A7%86%E5%8C%96%E5%9B%BE%E5%BD%A2%E5%B7%A5%E5%85%B7Portainer/" title="可视化图形工具Portainer">     <img class="post_bg" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/img/default.jpg" onerror="this.onerror=null;this.src='/codingdgsun/img/404.jpg'" alt="可视化图形工具Portainer"></a></div><div class="recent-post-info"><a class="article-title" href="/codingdgsun/2021/12/14/%E5%8F%AF%E8%A7%86%E5%8C%96%E5%9B%BE%E5%BD%A2%E5%B7%A5%E5%85%B7Portainer/" title="可视化图形工具Portainer">可视化图形工具Portainer</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">Created</span><time datetime="2021-12-14T13:46:22.000Z" title="Created 2021-12-14 21:46:22">2021-12-14</time></span></div><div class="content">Portainer是一个可视化的容器镜像的图形管理工具，利用Portainer可以轻松构建，管理和维护Docker环境。 而且完全免费，基于容器化的安装方式，方便高效部署。1docker run -d -p 8888:9000 --restart=always -v /var/run/docker.sock:/var/run/docker.sock --privileged=true portainer/portainer        //下载并运行portainer

1localhost:8888       //测试查看网站

创建用户，进行登录
选择查看管理本地容器

</div></div></div><div class="recent-post-item"><div class="post_cover left_radius"><a href="/codingdgsun/2021/12/14/Docker%E4%B8%8A%E9%83%A8%E7%BD%B2%E6%9C%8D%E5%8A%A1%E5%BA%94%E7%94%A8/" title="Docker上部署服务应用">     <img class="post_bg" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/img/default.jpg" onerror="this.onerror=null;this.src='/codingdgsun/img/404.jpg'" alt="Docker上部署服务应用"></a></div><div class="recent-post-info"><a class="article-title" href="/codingdgsun/2021/12/14/Docker%E4%B8%8A%E9%83%A8%E7%BD%B2%E6%9C%8D%E5%8A%A1%E5%BA%94%E7%94%A8/" title="Docker上部署服务应用">Docker上部署服务应用</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">Created</span><time datetime="2021-12-14T08:28:52.000Z" title="Created 2021-12-14 16:28:52">2021-12-14</time></span></div><div class="content">部署Nginx1docker pull nginx       //下载Nginx镜像

1docker run -d --name=&quot;MyNginx01&quot; -p 3090:80 nginx       //后台方式，以外部主机端口3090映射容器端口80，运行Nginx，容器别名为MyNginx01

1curl localhost:3090     //在外部主机测试容器Nginx服务


12docker exec -it 53c01c475a1e /bin/bash      //进入容器whereis nginx       //查看Nginx所在位置

部署Tomcat123docker run -it --rm -p 8888:8080 tomcat:9.0     //交互方式，以外部主机端口8888映射容器端口8080，运行Tomcat。用完后，退出容器后，立即删除镜像，一般用于测试使用。ctrl + c        //退出，查看镜像，确实消失了


1docker pull tomcat      //下载Tomcat镜像

1docker  ...</div></div></div><div class="recent-post-item"><div class="post_cover right_radius"><a href="/codingdgsun/2021/12/13/Docker%E4%BD%BF%E7%94%A8%E5%85%A5%E9%97%A8/" title="Docker使用入门">     <img class="post_bg" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/img/default.jpg" onerror="this.onerror=null;this.src='/codingdgsun/img/404.jpg'" alt="Docker使用入门"></a></div><div class="recent-post-info"><a class="article-title" href="/codingdgsun/2021/12/13/Docker%E4%BD%BF%E7%94%A8%E5%85%A5%E9%97%A8/" title="Docker使用入门">Docker使用入门</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">Created</span><time datetime="2021-12-13T06:43:08.000Z" title="Created 2021-12-13 14:43:08">2021-12-13</time></span></div><div class="content">Docker官网地址https://www.docker.com
docker镜像常用命令1docker version      //查看版本

1docker --help       //查看帮助

1docker images --help        //查看镜像帮助

1docker search --help        //查看搜索帮助

1docker search mysql     //搜索镜像，比如：mysql

1docker search mysql --filter=STARTs=6000        //过滤搜索STARS大于6000的镜像

1docker pull --help      //查看下载镜像帮助

1docker pull mysql       //下载最新镜像mysql


查看dockerhub里面的镜像版本

1docker pull mysql:5.7       //下载指定版本的镜像mysql，版本需在dockerhub里面存在


1docker images       //查看镜像

1docker rmi - ...</div></div></div><nav id="pagination"><div class="pagination"><a class="extend prev" rel="prev" href="/codingdgsun/page/2/#content-inner"><i class="fas fa-chevron-left fa-fw"></i></a><a class="page-number" href="/codingdgsun/">1</a><a class="page-number" href="/codingdgsun/page/2/#content-inner">2</a><span class="page-number current">3</span><a class="page-number" href="/codingdgsun/page/4/#content-inner">4</a><span class="space">&hellip;</span><a class="page-number" href="/codingdgsun/page/6/#content-inner">6</a><a class="extend next" rel="next" href="/codingdgsun/page/4/#content-inner"><i class="fas fa-chevron-right fa-fw"></i></a></div></nav></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src="https://cdn.jsdelivr.net/gh/CodingDGSun/images-db@master/Blog/头像.7horht40yvwg.jpg" onerror="this.onerror=null;this.src='/codingdgsun/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">CodingDGSun</div><div class="author-info__description"></div></div><div class="card-info-data"><div class="card-info-data-item is-center"><a href="/codingdgsun/archives/"><div class="headline">Articles</div><div class="length-num">59</div></a></div></div><a class="button--animated" id="card-info-btn" href="https://sunjie23.gitee.io/codingdgsun"><i class="fab fa-github"></i><span>Follow Me</span></a></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn card-announcement-animation"></i><span>Announcement</span></div><div class="announcement_content">This is my Blog</div></div><div class="sticky_layout"><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>Recent Post</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/codingdgsun/2022/01/17/React%E9%A1%B9%E7%9B%AEbuild%E5%A4%B1%E8%B4%A5%E4%B9%8BMiniCssExtractPlugin/" title="React项目build失败之MiniCssExtractPlugin"><img src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/img/default.jpg" onerror="this.onerror=null;this.src='/codingdgsun/img/404.jpg'" alt="React项目build失败之MiniCssExtractPlugin"/></a><div class="content"><a class="title" href="/codingdgsun/2022/01/17/React%E9%A1%B9%E7%9B%AEbuild%E5%A4%B1%E8%B4%A5%E4%B9%8BMiniCssExtractPlugin/" title="React项目build失败之MiniCssExtractPlugin">React项目build失败之MiniCssExtractPlugin</a><time datetime="2022-01-17T06:03:03.000Z" title="Created 2022-01-17 14:03:03">2022-01-17</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/codingdgsun/2022/01/17/React%E9%A1%B9%E7%9B%AE%E6%9E%84%E5%BB%BA%E5%B8%B8%E7%94%A8%E5%91%BD%E4%BB%A4/" title="React项目构建常用命令"><img src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/img/default.jpg" onerror="this.onerror=null;this.src='/codingdgsun/img/404.jpg'" alt="React项目构建常用命令"/></a><div class="content"><a class="title" href="/codingdgsun/2022/01/17/React%E9%A1%B9%E7%9B%AE%E6%9E%84%E5%BB%BA%E5%B8%B8%E7%94%A8%E5%91%BD%E4%BB%A4/" title="React项目构建常用命令">React项目构建常用命令</a><time datetime="2022-01-17T06:01:56.000Z" title="Created 2022-01-17 14:01:56">2022-01-17</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/codingdgsun/2022/01/17/Mac-OS%E5%88%9D%E5%A7%8B%E5%8C%96%E4%B8%80%E4%B8%AAReact%E9%A1%B9%E7%9B%AE/" title="Mac OS初始化一个React项目"><img src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/img/default.jpg" onerror="this.onerror=null;this.src='/codingdgsun/img/404.jpg'" alt="Mac OS初始化一个React项目"/></a><div class="content"><a class="title" href="/codingdgsun/2022/01/17/Mac-OS%E5%88%9D%E5%A7%8B%E5%8C%96%E4%B8%80%E4%B8%AAReact%E9%A1%B9%E7%9B%AE/" title="Mac OS初始化一个React项目">Mac OS初始化一个React项目</a><time datetime="2022-01-17T05:58:21.000Z" title="Created 2022-01-17 13:58:21">2022-01-17</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/codingdgsun/2022/01/17/MySQL%E8%AF%AD%E6%B3%95%E5%85%A5%E9%97%A8%EF%BC%88%E4%BA%8C%EF%BC%89/" title="MySQL语法入门（二）"><img src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/img/default.jpg" onerror="this.onerror=null;this.src='/codingdgsun/img/404.jpg'" alt="MySQL语法入门（二）"/></a><div class="content"><a class="title" href="/codingdgsun/2022/01/17/MySQL%E8%AF%AD%E6%B3%95%E5%85%A5%E9%97%A8%EF%BC%88%E4%BA%8C%EF%BC%89/" title="MySQL语法入门（二）">MySQL语法入门（二）</a><time datetime="2022-01-17T05:54:56.000Z" title="Created 2022-01-17 13:54:56">2022-01-17</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/codingdgsun/2022/01/17/Java%E4%B8%AD%E5%B8%B8%E8%A7%81%E9%9D%A2%E8%AF%95%E9%A2%98%E4%BA%8C%EF%BC%88%E7%AE%80%E5%8D%95%EF%BC%89/" title="Java中常见面试题二（简单）"><img src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/img/default.jpg" onerror="this.onerror=null;this.src='/codingdgsun/img/404.jpg'" alt="Java中常见面试题二（简单）"/></a><div class="content"><a class="title" href="/codingdgsun/2022/01/17/Java%E4%B8%AD%E5%B8%B8%E8%A7%81%E9%9D%A2%E8%AF%95%E9%A2%98%E4%BA%8C%EF%BC%88%E7%AE%80%E5%8D%95%EF%BC%89/" title="Java中常见面试题二（简单）">Java中常见面试题二（简单）</a><time datetime="2022-01-17T05:53:56.000Z" title="Created 2022-01-17 13:53:56">2022-01-17</time></div></div></div></div><div class="card-widget card-archives"><div class="item-headline"><i class="fas fa-archive"></i><span>Archives</span></div><ul class="card-archive-list"><li class="card-archive-list-item"><a class="card-archive-list-link" href="/codingdgsun/archives/2022/01/"><span class="card-archive-list-date">January 2022</span><span class="card-archive-list-count">9</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/codingdgsun/archives/2021/12/"><span class="card-archive-list-date">December 2021</span><span class="card-archive-list-count">21</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/codingdgsun/archives/2021/07/"><span class="card-archive-list-date">July 2021</span><span class="card-archive-list-count">15</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/codingdgsun/archives/2021/06/"><span class="card-archive-list-date">June 2021</span><span class="card-archive-list-count">14</span></a></li></ul></div><div class="card-widget card-webinfo"><div class="item-headline"><i class="fas fa-chart-line"></i><span>Info</span></div><div class="webinfo"><div class="webinfo-item"><div class="item-name">Article :</div><div class="item-count">59</div></div><div class="webinfo-item"><div class="item-name">UV :</div><div class="item-count" id="busuanzi_value_site_uv"></div></div><div class="webinfo-item"><div class="item-name">PV :</div><div class="item-count" id="busuanzi_value_site_pv"></div></div><div class="webinfo-item"><div class="item-name">Last Push :</div><div class="item-count" id="last-push-date" data-lastPushDate="2022-01-17T06:06:45.477Z"></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">&copy;2020 - 2022 By CodingDGSun</div><div class="framework-info"><span>Framework </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>Theme </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="darkmode" type="button" title="Switch Between Light And Dark Mode"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="Toggle between single-column and double-column"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="Setting"><i class="fas fa-cog fa-spin"></i></button><button id="go-up" type="button" title="Back To Top"><i class="fas fa-arrow-up"></i></button></div></div><div><script src="/codingdgsun/js/utils.js"></script><script src="/codingdgsun/js/main.js"></script><div class="js-pjax"></div><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div></body></html>